#pragma once

#include "Shader.h"


namespace RenderSystem
{
	class GlobalShaderType
		:public ShaderType 
	{
	public:

		typedef Shader::CompiledShaderInitializerType CompiledShaderInitializerType;
		typedef Shader* (*ConstructCompiledType)(const CompiledShaderInitializerType&);

		GlobalShaderType(
			const TCHAR* InName,
			const TCHAR* InSourceFilename,
			const TCHAR* InFunctionName,
			ConstructSerializedType InConstructSerializedRef,
			ConstructCompiledType InConstructCompiledRef,
			ModifyCompilationEnvironmentType InModifyCompilationEnvironmentRef
			):
		ShaderType(InName,InSourceFilename,InFunctionName,InConstructSerializedRef,InModifyCompilationEnvironmentRef),
			m_ConstructCompiledRef(InConstructCompiledRef)
		{}

		virtual ~GlobalShaderType(void);

		virtual GlobalShaderType* GetGlobalShaderType() { return this; }

		Shader* CompileShader( void );

	private:
		ConstructCompiledType m_ConstructCompiledRef;
	};

	/*
	A shader meta type for the simplest shaders; shaders which are not material or vertex factory linked.
	There should only a single instance of each simple shader type.
	*/
	class GlobalShader
		:public Shader
	{
		DECLARE_SHADER_TYPE(GlobalShader,Global);
	public:

		GlobalShader( void ): Shader() {}

		GlobalShader( const ShaderMetaType::CompiledShaderInitializerType& rInitializer ):Shader(rInitializer){}
		virtual ~GlobalShader( void ){}
	};

}